	<div id="fb-root"></div>
		<script src="http://connect.facebook.net/en_US/all.js"></script>
		<script>
		FB.init({
		 appId  : '254387861355717',
		 status : true, // check login status
		 cookie : true, // enable cookies to allow the server to access the session
		 xfbml  : true// parse XFBML
		 });
		FB.Canvas.setSize({ width: 640, height: 1800 });

		 </script>
<?php 
		$facebook = new Ishali_Facebook();
		$fb = $facebook->getFB();			
		/*
		if(isset($_GET['request_ids'])){                             
		 $reqId = $_GET['request_ids'];
		 $requests = $fb->api('/me/apprequests/?request_ids='.$reqId);    

		 $itemData = $requests['data'][0]['data'];
		 
		 if(isset($itemData) && $itemData !=""){
			echo "<script language='javascript'>top.location.href='" . $itemData . "'</script>";
			exit(0);
		 }else
			 if(isset($requests['data'][1]['data']) && $requests['data'][1]['data'] !=""){
				echo "<script language='javascript'>top.location.href='" . $requests['data'][1]['data'] . "'</script>";
				exit(0);
			 }else
			 if(isset($requests['data'][2]['data']) && $requests['data'][2]['data'] !=""){
				echo "<script language='javascript'>top.location.href='" . $requests['data'][2]['data'] . "'</script>";
				exit(0);
			 }
		}
		*/
		$signed_request = $fb->getSignedRequest();
		 if($signed_request  && $signed_request['page']['id'])
         {
			$_SESSION['haslike'] =  $signed_request['page']['liked'];
		//	$_SESSION['pageid'] =  $signed_request['page']['id'];
	       		 
         }
		 if($signed_request && $signed_request['page']['id'])
         {
			$_SESSION['pageid'] =  $signed_request['page']['id'];	       		 
         }
/*
		 echo "<pre>";		 
print_r($requests);
echo "</pre>";
*/
?>
<div class="search">
    <form method="get" action="<?php echo APP_DOMAIN . '/index/search' ?>">
        <ul>
            <li>
                <input class="styleinput" type="text" name="textSearch" value="<?php echo $this->textSearch; ?>" >
            </li>
            <li>
                <select class="styleselect" name="filter">                    
                    <option value="1">Tên</option>
                    <option value="2">Mã thí sinh</option>
                </select>
            </li>
            <li>
                <input class="stylebtsearch" type="submit" value="" >
            </li>
            <li class="stsapxep">
             <?php 
	             $select1='';
	             $select2='';
	             $select3='';
	             $select4='';
	             $select5='';
	             $select6='';
                switch ($this->order) {
		     	    case 1: {
		                    $select1= " selected='selected' ";
		                    break;
		                }
		            case 2: {
		                   $select2= " selected='selected' ";
		                    break;
		                }
		            case 3: {
		                  	$select3= " selected='selected' ";
		                    break;
		                }
		            case 4: {
		                   $select4= " selected='selected' ";
		                    break;
		                }
                	case 5: {
		                  	$select5= " selected='selected' ";
		                    break;
		                }
		            case 6: {
		                   $select6= " selected='selected' ";
		                    break;
		                }
		        }
             ?>
                <select class="styleselect" name="order" onChange="this.form.submit()"> 
             		<option value="0">Sắp xếp</option>    
             		<optgroup label="Bình Luận">               
                    <option <?php echo $select1 ?> value="1">Bình luận tăng</option>
                    <option <?php echo $select2 ?> value="2">Binh luận giảm</option>
                    <optgroup label="Lượt Xem"> 
                    <option <?php echo $select3 ?> value="3">Lượt xem tăng</option>
                    <option <?php echo $select4 ?> value="4">Lượt xem giảm</option>
                     <optgroup label="Mã thí sinh"> 
                    <option <?php echo $select5 ?> value="5">Mã tăng</option>
                    <option <?php echo $select6 ?> value="6">Mã giảm</option>
                </select>
            </li>
        </ul>
    </form>
<?php 
?>
</div>
<div class="clear"></div>
<div id='paging' style="display: none">
    <?php
    echo $this->paging;
    ?>
</div>
<div>
    <?php if (count($this->listInfo) > 0) { ?>

        <ul class="list-info">        
            <?php foreach ($this->listInfo as $info) { ?>
                <li>
                    <div class="hathamgia">
                        <a href="<?php echo APP_DOMAIN; ?>/index/detail?mts=<?php echo base64_encode('a7'.$info->id_thi_sinh)?>">
                            <?php
                            $images = json_decode($info->hinh_du_thi);
							if( $images[0])
							{
								$imageLink = APP_DOMAIN . '/public/images/' . $images[0];
							}else
							{
								$imageLink = APP_DOMAIN . '/public/images/khongcohinh.jpg';
							}
                            ?>
                            <img class="thumb" src="<?php echo $imageLink; ?>" />
                        </a>
                    </div>
					<?php if ($this->page->show_ten) { ?>
                        <p><?php echo $info->ten_thi_sinh; ?></p>    
                    <?php } ?>
                    <?php if ($this->page->show_gioi_thieu) { ?>
                        <p><?php echo $info->gioi_thieu; ?></p>    
                    <?php } ?>  
                    <?php if ($this->page->show_luot_xem) { ?>
                        <p>Lượt xem : <?php echo $info->luot_xem; ?></p>    
                    <?php } ?>
                    <?php if ($this->page->show_so_binh_chon) { ?>
                        <p>Bình chọn : <?php echo $info->luot_binh_chon; ?></p>    
                    <?php } ?>
                    <?php if ($this->page->show_ma) { ?>
                        <p>Mã : <?php echo $info->mathisinh; ?></p>    
                    <?php } ?>
                </li>
            <?php } ?>
        </ul>
    <?php } else { ?>
        <p>Không có thí sinh nào</p>
    <?php } ?>
</div>

<script>
    common.renderPagingSearch('paging', 'trang trước', 'trang sau', 'Trang đầu', 'Trang cuối', '<?php echo $this->keyword; ?>');
</script>